/*
  Jeffrey Minton
  kurk.h
  Kurk class: contains all front end functionality of the program
  contains all main event handlers
*/

#ifndef KURK_H
#define KURK_H

#include <QMainWindow>
#include "connection.h"
#include "controller.h"
#include "camera.h"
#include "video.h"
#include "iostream"
#include "robot.h"
#include <QFile>
#include <QTextStream>
#include "iostream"

namespace Ui {
    class Kurk;
}

class Kurk : public QMainWindow {
    Q_OBJECT
public:
    Kurk(QWidget *parent = 0);
    ~Kurk();
    void moveTurret();

protected:
    void changeEvent(QEvent *e);

    //on form close
    void closeEvent(QCloseEvent *event);


private slots://all events that can be received
    void on_connectBtn_clicked();
    void on_distBtn_clicked();
    void on_forwardBtn_clicked();
    void on_reverseBtn_clicked();
    void on_leftBtn_clicked();
    void on_rightBtn_clicked();
    void on_stopBtn_clicked();
    void on_getImageBtn_clicked();
    void on_connectCamBtn_clicked();
    void on_angleSpin_valueChanged();
    void on_testSerialBtn_clicked();
    void on_getVideoBtn_clicked();
    void on_turretSlider_valueChanged();
    void on_turretSlider_sliderMoved();
    void on_btnStart_clicked();
    void on_btnSetVals_clicked();
    void on_btnGetVals_clicked();
    void on_btnLoadVals_clicked();
    void on_btnSaveVals_clicked();
    void on_btnStop_clicked();
    void on_btnLoadImage_clicked();

private:
    Ui::Kurk *ui;
    Connection comm;
    Controller arduino;
    Camera cam;
    Video vidIn;
    QMessageBox alert;
    int imgNum;
    Robot bot;
};

#endif // KURK_H
